package com.hllxd.hism.star.basic.service.constant.alarm;

/**
 * @description 计算类型枚举
 * @auhtor wuguangxi
 * @date 2021/12/31 16:50
 **/
public enum CalculateTypeEnum {
    LINK("link", "环比"),
    DAY("day", "昨天同比"),
    WEEK("week", "周同比");
//    LINK_CONTRAST("link_contrast", "环比对照"),
//    DAY_CONTRAST("day_contrast", "昨天同比对照"),
//    WEEK_CONTRAST("week_contrast", "上周同比对照");

    private final String name;

    private final String code;

    CalculateTypeEnum(String code, String name){
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public static CalculateTypeEnum getByCode(String code){
        for(CalculateTypeEnum calculateTypeEnum : CalculateTypeEnum.values()){
            if(calculateTypeEnum.getCode().equals(code)){
                return calculateTypeEnum;
            }
        }
        return null;
    }
}
